package com.example.tliasmanagement.controller;

import com.example.tliasmanagement.dto.LogListDto;
import com.example.tliasmanagement.entity.Log;
import com.example.tliasmanagement.service.LogService;
import com.example.tliasmanagement.vo.LogListVo;
import com.example.tliasmanagement.vo.PageBean;
import com.example.tliasmanagement.vo.Result2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LogController {
    @Autowired
    private LogService logService;

    /* *
     * 日志列表分页查询
     *
     * */
    @CrossOrigin(origins = {"http://127.0.0.1:5173","http://localhost:5173"})
    @GetMapping("/log/page")
    public Result2<PageBean<Log>> logs(LogListDto dto){
        PageBean<Log> pageBean = logService.logs(dto);
        return Result2.ok(pageBean);
    }
}
